home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 126-150 / disk_130 / qman / qman_graphics.include < prev    next >
Text File  |  1992-05-06  |  3KB  |  94 lines

  1.  
  2. /*------------------------------------------------*/
  3. /*       File:   qman_graphics.include            */
  4. /*                                                */
  5. /*       Sets up custom screen and window for     */
  6. /*       qman routine.  The screen will always    */
  7. /*       be hi-res with 16 colors, but may or     */
  8. /*       may not be interlaced.                   */
  9. /*------------------------------------------------*/
  10.  
  11. void SetUpMandelGraphics()
  12. {
  13.   topaz_eight.ta_Name  = "topaz.font";
  14.   topaz_eight.ta_YSize = 8;
  15.   topaz_eight.ta_Style = 0;
  16.   topaz_eight.ta_Flags = 0;
  17.  
  18.   /*  Define properties new screen is to have:        */
  19.   ns.LeftEdge     =   0;
  20.   ns.TopEdge      =   0;
  21.   ns.Width        = 640;
  22.   ns.Height       = vertical_res;
  23.   ns.Depth        =   4;
  24.   ns.DetailPen    =   1;
  25.   ns.BlockPen     =   2;
  26.  
  27.   ns.ViewModes    = HIRES;
  28.   if ( ilace == 1 ) ns.ViewModes = HIRES + LACE;
  29.  
  30.   ns.Type         = CUSTOMSCREEN;
  31.   ns.Font         = &topaz_eight;
  32.   ns.DefaultTitle = "    \0";
  33.   ns.Gadgets      = NULL;
  34.   ns.CustomBitMap = NULL;
  35.  
  36.   mandel_screen = (struct Screen *)OpenScreen( &ns );
  37.   if ( mandel_screen == NULL ) exit();
  38.  
  39.   /*   Describe new window:      */
  40.   nw.LeftEdge    =    0;
  41.   nw.TopEdge     =    0;
  42.   nw.Width       =  640;
  43.   nw.Height      =  vertical_res;
  44.   nw.DetailPen   =   -1;
  45.   nw.BlockPen    =   -1;
  46.   nw.IDCMPFlags  = MOUSEBUTTONS | MENUPICK;
  47.   nw.Type        = CUSTOMSCREEN;
  48.   nw.Flags       = ACTIVATE | NOCAREREFRESH | BORDERLESS | REPORTMOUSE;
  49.   nw.FirstGadget = NULL;
  50.   nw.CheckMark   = NULL;
  51.   nw.Screen      = mandel_screen;
  52.   nw.Title       = NULL;
  53.   nw.BitMap      = NULL;
  54.   nw.MinWidth    =    0;
  55.   nw.MinHeight   =    0;
  56.   nw.MaxWidth    =    0;
  57.   nw.MaxHeight   =    0;
  58.  
  59.   mandel_window = (struct Window *)OpenWindow( &nw );
  60.   if (mandel_window == NULL)    exit();
  61.  
  62.   WindowToFront(mandel_window);
  63.  
  64.   rp = mandel_window  -> RPort;
  65.   vp = &mandel_screen -> ViewPort;
  66.  
  67.   /*  Set the six colors reserved for menu use:  */
  68.   SetRGB4( vp,  0,     0,   0,  0 );   
  69.   SetRGB4( vp,  1,    15,   9,  0 );
  70.   SetRGB4( vp,  2,     0,   8,  0 );
  71.   SetRGB4( vp, 13,    10,  10, 10 );
  72.   SetRGB4( vp, 14,     0,   0,  0 );
  73.   SetRGB4( vp, 15,    10,   0,  2 );
  74.  
  75.  
  76.   /*  Now set the colors we use for the actual fractals:  */
  77.   if ( screen_changed )   /* preserve existing colors */
  78.     for ( i = 3; i < 13; i++) SetRGB4(vp,i, reds[i], greens[i], blues[i] ); 
  79.  
  80.   else {  /* Set up initial color values */
  81.  
  82.     SetRGB4( vp,  3,     4,   0,  2 );
  83.     SetRGB4( vp,  4,     5,   0,  2 );
  84.     SetRGB4( vp,  5,     6,   0,  3 );   
  85.     SetRGB4( vp,  6,     7,   0,  3 );
  86.     SetRGB4( vp,  7,     8,   0,  3 );
  87.     SetRGB4( vp,  8,     9,   0,  3 );
  88.     SetRGB4( vp,  9,    10,   0,  3 );
  89.     SetRGB4( vp, 10,    11,   0,  4 );
  90.     SetRGB4( vp, 11,    12,   0,  4 );   
  91.     SetRGB4( vp, 12,    13,   0,  4 ); }
  92.  
  93. }
  94.